#pragma once


#include<stdio.h>
#include<assert.h>
#include<stdlib.h>


typedef int heapDataType;

typedef struct heap
{
	heapDataType* data;
	int size;
	int capacity;
}HP;

void heapInit(HP* hp);

void heapDestroy(HP* hp);

void heapPush(HP* hp, heapDataType x);

void heapPop(HP* hp);

void adjustUp(heapDataType* data, int child);

void adjustDown(heapDataType* data, int size, int parent);

void swap(heapDataType* child, heapDataType* parent);

void heapPrint(HP* hp);